<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="/End/Public/Admin/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="/End/Public/Admin/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="/End/Public/Admin/Css/style.css" />
    <script type="text/javascript" src="/End/Public/Admin/Js/jquery.js"></script>
    <script type="text/javascript" src="/End/Public/Admin/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="/End/Public/Admin/Js/bootstrap.js"></script>
    <script type="text/javascript" src="/End/Public/Admin/Js/ckform.js"></script>
    <script type="text/javascript" src="/End/Public/Admin/Js/common.js"></script>
    <script type="text/javascript" src="/End/Public/Admin/Js/layer.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }
        .container {
            width: 1000px;
            margin-top: 100px;
        }
        .content {
            padding: 20px 30px;
            border: 1px solid #e2e2e2;
            background-color: #f5f7fa;
        }
        .title-container {
            font-size: 20px;
            display: flex;
            justify-content: space-between;
        }

        .content-container {
            text-indent: 2em;
            margin-top: 21px;
            font-size: 16px;
        }

        .block {
            display: flex;
            border: 1px solid #E5E5E5;
            margin-top: 1px;
        }

        .author {
            font-size: 17px;
        }

        .header {
            width: 200px;
            height: 300px;
            display: flex;
            flex-direction: column;
            padding-top: 44px;
            align-items: center;
            border-right: 1px solid #E5E5E5;
        }

        .head-img {
            padding: 5px;
            border: 1px solid #CCC;
        }

        .info {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin-top: 20px;
        }

        .article {
            flex: 1;
            padding: 38px 15px 25px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .article-title {
            display: flex;
            justify-content: center;
        }

        .article-content {
            text-indent: 2em;
            margin-top: 10px;
            font-size: 16px;
        }

        .other {
            display: flex;
            justify-content: flex-end;
        }

        .date {
            margin-right: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .article-del {
            width: 45px;
            padding: 3px;
            border: 1px solid #ab9f9f;
            border-radius: 8px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            font-size: 12px;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <div class="content">
        <div class="title-container">
         <label>标题： <?php echo ($post_info["title"]); ?></label>
        </div>
        <div class="content-container">
            <?php echo ($post_info["content"]); ?>
        </div>
    </div>

    <?php if(is_array($comment_info)): foreach($comment_info as $key=>$vo): ?><div class="block">
            <div class="header">
                <div class="head-img"><img width="90px" height="90px" src="<?php echo ($vo["headurl"]); ?>"></div>
                <div class="info">
                    <div class="author"><?php echo ($vo["username"]); ?></div>
                </div>
            </div>
            <div class="article">
                <div class="article-container">
                    <div class="article-content"><?php echo ($vo["content"]); ?></div>
                </div>
                <div class="other">
                    <div class="date"><?php echo ($vo["time"]); ?></div>
                    <div class="article-del" > <a onclick="del(<?php echo ($vo['id']); ?>)" >删除</a></div>
                </div>
            </div>
        </div><?php endforeach; endif; ?>
</div>


		</body>
		</html>

<script>

	function del(id)
    {

        if(confirm("确定要删除吗？"))
        {
            $.ajax({
                url:"<?php echo U('post/del_comment');?>",
                dataType:"json", //返回的数据类型,text 或者 json数据，建议为json
                type:"get", //传参方式，get 或post
                data:{id:id //传过去的参数，格式为 变量名：变量值
                },
                error: function(msg){  //若Ajax处理失败后回调函数，msg是返回的错误信息
                    alert( "网络请求错误,请重试！");
                },
                success: function(data) { //若Ajax处理成功后的回调函数，text是返回的页面信息
                    if(data=='1'){
                        window.location.reload();
                    }else{
                        alert("删除失败");
                    }

                }
            });


        }
	
	
	
	
	}
</script>